#include<iostream>
using namespace std;

class B;

class C {
    public:
        virtual void constFun() const {};
};

class A : public C{
    private:
        int a;
    public:
        void func(B&);
        A(int i) {a = i;}
        void constFun() const {
            cout << "class A const function" << endl;
        }
};

class B {
    private:
        int b;
        friend void A::func(B&);
    public:
        B(int i) {b = i;}
        void constFun() {

        }
};

void A::func(B& b) {
    a = b.b;
    cout << a << endl;
}

int main() {
    B bt(3);
    A at(10);
    at.func(bt);
    return 0;
}
